package JZ.JZ38;

/**
 * @author corn
 * @create 2020-07-20-14:53
 */
public class TreeDepthJZ38 {

}
class Solution12 {
    public int TreeDepth(TreeNode4 root) {
        if (root == null) return 0;
        int lval = TreeDepth(root.left);
        int rval = TreeDepth(root.right);
        return (lval>rval?lval:rval) + 1;
    }
}
class TreeNode4 {
    int val = 0;
    TreeNode4 left = null;
    TreeNode4 right = null;

    public TreeNode4(int val) {
        this.val = val;

    }
}